<include file="Public:header" />
<include file="websites.js" />
    <h3 class="title"><em>新增网站</em><span><a href="{:U('index')}">返回列表&nbsp;&rsaquo;&nbsp;</a></span><span><a href="{:U('Webapply/index')}">返回审核列表&nbsp;&rsaquo;&nbsp;</a></span></h3>
	<div class="formbox">
    	<form name="mform" method="post" action="{:U('add')}" enctype="multipart/form-data">
        <input type="hidden" name="apply_id" id="apply_id" value="{$info['id']}" /><!--审核列表过来的id-->
		<table width="100%" border="0" cellspacing="1" cellpadding="0">
			<tr>
				<th>所属地区：</th>
				<td><select name="province_id" id="province_id" class="sel">
                		<option value="0">-省份-</option>
                        <volist name="province" id="pro">
                        <option value="{$pro['id']}">{$pro['name']}</option>
                        </volist>
                	</select>
                    <select name="city_id" id="city_id" class="sel">
                    	<option value="0">-城市-</option>
                        <volist name="city" id="ct">
                        <option value="{$ct['id']}">{$ct['name']}</option>
                        </volist>
                    </select></td>
			</tr>
            <tr>
				<th>所属分类：</th>
				<td>
                	<select name="cate_id" id="cate_id" class="sel">
                    	<option value="0">请选择分类</option>
                        {$cateOption}
                    </select>
                    <script type="text/javascript">
					$(function(){
						$("#cate_id").val("{$info['cate_id']}");	
						$("#province_id").val("{$info['province_id']}");	
						$("#city_id").val("{$info['city_id']}");		
					});
					</script>
                </td>
			</tr>
			
			<tr>
				<th>网站域名：</th>
				<td><input name="domain" type="text" class="ipt" id="domain" size="50" maxlength="255" value="{$info['domain']}"  onblur="stripHttp()" /><input type="button" class="btn" id="btn-get-meta" value="抓取Meta" onclick="getMeta();"><span class="tips">不需要http; 例: www.mainwww.com</span></td>
			</tr>
            <tr>
				<th>网站名称：</th>
				<td><input name="name" type="text" class="ipt" id="name" size="50" maxlength="50" value="{$info['name']}" /></td>
			</tr>
			<tr>
				<th>网站标题：</th>
				<td><input name="title" type="text" class="ipt" id="title" size="50" maxlength="100" value="{$info['title']}" /><span class="tips">标题长度限制在80个字符以内</span></td>
			</tr>
			<tr>
				<th>网站keywords：</th>
				<td><input name="keywords" type="text" class="ipt" id="keywords" size="50" maxlength="255" value="{$info['keywords']}" onBlur="javascript:this.value=this.value.replace(/，/ig,',');" /><span class="tips">多个keywords用英文的“,”逗号隔开</span></td>
			</tr>
			<tr>
				<th valign="top">网站描述：</th>
				<td><textarea name="description" cols="55" rows="8" class="ipt" id="description">{$info['description']}</textarea></td>
			</tr>
            
            <tr>
				<th>联系邮箱：</th>
				<td><input name="email" type="text" class="ipt" id="email" size="50" maxlength="50" value="{$info['email']}" /></td>
			</tr>
            
            <gt name="info['id']" value="0">
            <tr>
				<th>拒绝：</th>
				<td>
                <select id="status_message_sel" class="sel">
                		<option>网站涉黄赌毒等不健康内容</option>
                		<option>网址打不开</option>
                		<option>没有做本站友情链接</option>
                		<option>网站信息不完整(标题,关键词,描述)</option>
                		<option>分类不准确</option>
                	</select>
                <br />
				<input name="status_message" type="text" class="ipt" id="status_message" size="50" maxlength="50" value="{$info['status_message']|default='网站涉黄赌毒等不健康内容'}" />
                <input type="button" class="btn" id="btn-status" value="拒绝">&nbsp;<input type="reset" class="btn" value=" 返 回 " onClick="window.location.href='{:U('/Webapply/index',session('webapplyPageInfo'))}';"><br />
                <span class="tips">如果正常审核此信息不会记录，请直接操作完后点击最下面的保存按钮!</span></td>
			</tr>
            </gt>
            <tr>
				<th>服务器IP：</th>
				<td><input name="ip" type="text" class="ipt" id="ip" size="30" maxlength="30" /><input type="button" class="btn" id="btn-get-wdata" value="获取数据" onclick="getWdata();"><span class="tips">例: 127.0.0.1</span></td>
			</tr>
 			<tr>
				<th>BaiduRank：</th>
				<td><input name="brank" type="text" class="ipt" id="brank" size="10" maxlength="1" /></td>
			</tr>
 			<tr>
				<th>PageRank：</th>
				<td><input name="grank" type="text" class="ipt" id="grank" size="10" maxlength="1"  /></td>
			</tr>
 			<tr>
				<th>SogouRank：</th>
				<td><input name="srank" type="text" class="ipt" id="srank" size="10" maxlength="1"  /></td>
			</tr>
 			<tr>
				<th>AlexaRank：</th>
				<td><input name="arank" type="text" class="ipt" id="arank" size="10" maxlength="10"  /></td>
			</tr>
 			<tr>
				<th>点入次数：</th>
				<td><input name="instat" type="text" class="ipt" id="instat" size="10" maxlength="10" /> 次</td>
			</tr>
 			<tr>
				<th>点出次数：</th>
				<td><input name="outstat" type="text" class="ipt" id="outstat" size="10" maxlength="10" /> 次</td>
			</tr>
 			<tr>
				<th>浏览次数：</th>
				<td><input name="views" type="text" class="ipt" id="views" size="10" maxlength="10" /> 次</td>
			</tr>
			<tr>
				<th>属性设置：</th>
				<td>
                	<input name="is_pay" type="checkbox" id="is_pay" value="1" /><label for="is_pay">付费</label>&nbsp;
                    <input name="is_top" type="checkbox" id="is_top" value="1" /><label for="is_top">置顶</label>&nbsp;
                    <input name="is_best" type="checkbox" id="is_best" value="1" /><label for="is_best">推荐</label>
                </td>
			</tr>
			<tr>
				<th>审核状态：</th>
				<td><select name="status" id="status" class="sel">
                    <foreach name="statusArray" item="v" key="k">
                    <option value="{$k}">{$v}</option>
                    </foreach>
                </select>
                </td>
			</tr>
			<tr class="btnbox">
            	<th>&nbsp;</th>
				<td>
					<input type="submit" class="btn" value="保 存">&nbsp;
                    <gt name="info['id']" value="0">
                    <input type="reset" class="btn" value="取 消" onClick="window.location.href='{:U('/Webapply/index',session('webapplyPageInfo'))}';">
                    <else/>
                    <input type="reset" class="btn" value="取 消" onClick="window.location.href='{:U('index',session('pageInfo'))}';">
                    </gt>
					
				</td>
			</tr>
		</table>
        </form>
	</div>
<script type="text/javascript">
$(function(){
	$("#status_message_sel").change(function(){
		var val = $(this).val();
		$("#status_message").val(val);
	});
	$("#btn-status").click(function(){
		var statusMessage = $("#status_message").val();
		if(statusMessage == ''){
			alert('请给出拒绝理由!');
			return false;	
		}else{
			$('#btn-status').val('正在拒绝，请稍候...');
			$.ajax({
			   type: "POST",
			   url: "{:U('/Webapply/setStatus')}",
			   data: "id={$info['id']}&status_message="+statusMessage,
			   success: function(result){
					if(result['status'] == 1){
						
						$('#btn-status').val('拒绝成功,请点击右边的返回按钮返回!');
						$("#btn-status").unbind("click");
					}else{
						$('#btn-status').val(result['info']);	
					}
			   }
			});	
		}
	});	
});
</script>
<include file="Public:footer" />